<?php
namespace app\serversetting\validate;
use \app\manage\validate\BaseValidate;

class Setting extends BaseValidate
{
    
	protected $rule =   [
        'id' => ['integer','gt'=>0],
        'app_id' => ['array','min'=>1],
        'category_id' => ['integer','gt'=>0],
        'name' => ['length'=>'2,50'],
        'value' => ['min'=>1],
        'action' => ['min'=>2],
        'type' => ['in'=>'1,2,3,4'],
        'order'=>['integer','gt'=>0],
        'page'=>['integer','gt'=>0],
        'listRows'=>['integer','gt'=>0,'elt'=>50],
    ];

    protected $message  =   [
        'page' => '当前页为大于0的整数',
        'listRows' => '每页显示的条数范围为1-50',
    ];

    protected $scene = [
        'addSet' => ['category_id','name','value','action','type','order'],
        'editSet'=>[
            'id' => ['require','integer','gt'=>0],
            'category_id','name','value','action','type','order'
        ],
        'getOneSet'=>[
            'id' => ['require','integer','gt'=>0],
        ],
        'getAppSet'=>['page','listRows','app_id'],
        
    ];

}